import request from "../axios";

const api = {
    //创建用户收件地址
    address_create(data) {
        return request({
            url: "/member/address/create",
            method: "POST",
            data: data,
            noLoading:true
        });
    },
    //更新用户收件地址
    address_update(data) {
        return request({
            url: "/member/address/update",
            method: "PUT",
            data: data,
            noLoading:true
        });
    },
    //获得用户收件地址列表
    address_list(params) {
        return request({
            url: "/member/address/list",
            method: "GET",
            params: params,
        });
    },
    //获得用户收件地址
    address_get(params) {
        return request({
            url: "/member/address/get",
            method: "GET",
            params: params,
        });
    },
    //获得默认的用户收件地址
    address_get_default(params) {
        return request({
            url: "/member/address/get-default",
            method: "GET",
            params: params,
        });
    },
    //删除用户收件地址
    address_delete(params) {
        return request({
            url: "/member/address/delete",
            method: "DELETE",
            params: params,
            noLoading:true
        });
    },

    //获取地区树
    address_tree(){
        return request({
             url: "/system/area/tree",
             method:'GET',
        })
    }
};

export default api;
